//
// Created by hjie on 23-10-3.
//

#include "codec_config.h"

CodecConfig::CodecConfig()
{
	m_bit_rate     = 0;
	m_timebase     = {0,0};
	m_r_frame_rate = {0,0};
	m_width        = 0;
	m_height       = 0;
	m_bit_rate     = 0;

	m_format       = AV_PIX_FMT_NONE;
	m_sw_format    = AV_PIX_FMT_NONE;
	m_has_b_frame  = -1;
}

void CodecConfig::SetWidthHeight(int w, int h)
{
	m_width  = w;
	m_height = h;
}

void CodecConfig::SetTimebase(AVRational timebase)
{
	m_timebase = timebase;
}

void CodecConfig::SetRealBaseFrameRate(AVRational frmae_rate)
{
	m_r_frame_rate = frmae_rate;
}

void CodecConfig::SetCodecName(const std::string &name)
{
	m_codec_name = name;
}

void CodecConfig::SetWidth(int width)
{
	m_width = width;
}

void CodecConfig::SetHeight(int height)
{
	m_height = height;
}

void CodecConfig::SetFormatAndSwFormat(int format, int sw_format)
{
	m_format 	= format;
	m_sw_format = sw_format;
}

void CodecConfig::SetBitrate(int bit_rate)
{
	m_bit_rate = bit_rate;
}

void CodecConfig::SetHasBFrame(int num)
{
	m_has_b_frame = num;
}
